﻿namespace uTorrentNAS
{
    using System;
    using System.IO;
    using System.Windows.Forms;
    using Services;
    using Utilities;

    internal static class Program
    {
        /// <summary>
        ///     The main entry point for the application.
        /// </summary>
        [STAThread]
        private static void Main()
        {
            var configurationService = new ConfigurationService(
                new Serializer<Configuration>(
                    Path.Combine(
                        Application.UserAppDataPath,
                        Properties.Settings.Default.ConfigurationFilename)));

            var fileService = new FileService();

            var archiveService = new ArchiveService(configurationService, Properties.Settings.Default.UnRarFilename);

            var torrentService = new TorrentService(fileService, archiveService, configurationService);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm(configurationService, torrentService));
        }
    }
}